/**
 * Copyright 2016 Qiyi Inc. All rights reserved.
 *
 * @file:   StatisticOcr.Action.js
 * @path:   js-src/StatisticOcr/
 * @desc:   Action静态对象，声明对象以及绑定事件、对外接口等
 * @author: zhang@qiyi.com
 * @date:   2016-03-28
 */
qui(
    function(require, exports, module) {

        StatisticOcr.Action = (function() {

            //表格
            var statisticOcrGrid = null;

            var getStatisticOcrGrid = function (options) {
                if (!statisticOcrGrid) {
                    statisticOcrGrid = new StatisticOcr.Grid($.extend(true,
                    {'$container': $('#StatisticOcrListContainer'), '$hiddenGrid': $('#hiddenGrid'), type:0}, options))
                }

                return statisticOcrGrid;
            }

            var statisticOcrGridRun = function(options) {
                statisticOcrGrid = getStatisticOcrGrid(options);
                statisticOcrGrid.run();

                console.log('grid run');
            }

            //统计OCR列表
            var run = function() {
                Ancestor.Config.EPG_AUTH.list='/statisticOcr/list';
                statisticOcrGridRun({});
            }

            return {
                run:run,
                getStatisticOcrGrid:getStatisticOcrGrid
            }
        })();
    }
)